<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script src="https://unpkg.com/vue@next"></script>
<body>
    <div id="root"></div>    
</body>
<script>
    // data & methods & computed & watcher
    // computed 和method都能实现的一个功能，建议使用computed
    // computed和watcher都能实现的功能，建议使用computed
    const app = Vue.createApp({
     data() {
         return {
            count:1,
            price:5,
            newTotal:5
         }
     },
     watch: {
        price(current, prev){
            this.newTotal = this.count * current;
        }
     },
     methods: {
         
     },
     template: `
       <div>{{newTotal}}</div>
     `
    })

    const vm = app.mount('#root')
 </script>
</html>